//
//  vietnameseSlangAppDelegate.h
//  vietnameseSlang
//
//  Created by Leon on 21/09/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <CoreData/CoreData.h>
#import "SearchViewController.h"

#define UI_FONT_SIZE_BIG 28
#define UI_FONT_SIZE_BIGGER 18
#define UI_FONT_SIZE 14 
#define UI_FONT_SIZE_SMALLER 12
#define UI_FONT_SIZE_SMALL 10

#define UIColorFromRGB(rgbValue) [UIColor \
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

//Colors (because obj-C doesn't allow define UIColor as constants)
@interface UIColor (JMangoColor)
+ (UIColor *) GUI_COLOR_TEXT_DEFAULT;
+ (UIColor *) GUI_COLOR_TEXT_HIGHLIGHTED_IN_BACKGROUND;
+ (UIColor *) GUI_COLOR_TEXT_HIGHLIGHTED;

+ (UIColor *) GUI_COLOR_BORDER;
+ (UIColor *) GUI_COLOR_BACKGROUND_BAR;
+ (UIColor *) GUI_COLOR_BACKGROUND_HIGHLIGHTED;
@end



@interface vietnameseSlangAppDelegate : NSObject <UIApplicationDelegate,UITabBarControllerDelegate> {
    
    UIWindow *window;
    NSDictionary *settings;
    UITabBarController * tabBarController;
    SearchViewController * searchViewController;
    
@private
    NSManagedObjectContext *managedObjectContext_;
    NSManagedObjectModel *managedObjectModel_;
    NSPersistentStoreCoordinator *persistentStoreCoordinator_;
}
@property (nonatomic, retain) SearchViewController *searchViewController;
@property (nonatomic, retain) NSDictionary * settings;

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) UITabBarController *tabBarController;

@property (nonatomic, retain, readonly) NSManagedObjectContext *managedObjectContext;
@property (nonatomic, retain, readonly) NSManagedObjectModel *managedObjectModel;
@property (nonatomic, retain, readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator;

- (NSURL *)applicationDocumentsDirectory;
- (void)saveContext;

- (BOOL) isNetworkAvailable;
- (void) createTabBarController;

@end

